<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
body{
	background:url(./image/bluebg.png) #041623;
	margin:0;
	padding:0;
}
</style>
<link rel="stylesheet" type="text/css" href="../css/style.css">
</head>
<body>
	<div id="test" class="relation"></div>
</body>
<script type="text/javascript" src="../js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../js/relation_js_core.js"></script>
<script type="text/javascript">
	var nodes = [{id:'1', pId:'0', name: "根节点"},
	      	   {id:'111', pId:'0', name: "父节点11"},
	    	   {id:'2', pId:'1', name: "节点2"}
	    	   ,{id:'3', pId:'1', name: "节点3"},
	    	   {id:'4', pId:['1','2','3'], name: "节点4"},
	    	   {id:'5', pId:['4'], name: "节点5"},
	    	   {id:'6', pId:['2'], name: "节点6"},
	    	   {id:'7', pId:['1'], name: "节点7"},
	    	   {id:'8', pId:['3'], name: "节点8"},
	    	   {id:'9', pId:['1'], name: "节点9"},
	    	   {id:'10', pId:['9','7'], name: "节点10"},
	    	   {id:'11', pId:['4'], name: "节点11"},
	    	   {id:'12', pId:['4','5'], name: "节点13"},
	    	   {id:'13', pId:['6'], name: "节点13"},
	    	   {id:'14', pId:['8'], name: "节点13"},
	    	   {id:'15', pId:['14'], name: "节点15"},
	    	   {id:'17', pId:['15'], name: "节点17"},
	    	   {id:'18', pId:['17'], name: "节点18"},
	    	   {id:'19', pId:['18'], name: "节点19"},
	    	   {id:'20', pId:['19'], name: "节点20"} ];
	var obj = $("#test").relationJs({
		view : {
			autoCancelSelected : true,
			selectedMulti : true
		},
		data : {
			key : {
				parent : "pId",
				name : "name",
				id: 'id'
			}
		} 	
	},nodes);
	 var _nodes = obj.getNodes();
	 var parents = obj.getNodeById('15').getParents();
	 var childs = obj.getNodeById('15').getChilds();
	 var preNode = obj.getNodeById('15').getPreNode();
	 var nextNode = obj.getNodeById('11').getNextNode();
	 var nodelines = obj.getNodeById('15').getNodeLine();
	var __nodes =  obj.getNodesByParam("name",'子节点13',[obj.getNodeById('4'),obj.getNodeById('6')]);
</script>
</html>